﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace MedicalSystem.SmartReport.Viewer
{
    [ToolboxBitmap(@"Resources\L.JPG")]
    public partial class Lline : UserControl
    {
        public Lline()
        {
            InitializeComponent();
        }
        private int lineWidth = 1;

        private Color lineColor = SystemColors.ControlDark;

        private void UserControl3_Paint(object sender, PaintEventArgs e)
        {
            Graphics g = e.Graphics;
            Rectangle r = this.ClientRectangle;
            Pen darkpen = new Pen(lineColor, lineWidth);
          
            //用暗色调处理左边缘 
            g.DrawLine(darkpen, r.Left, r.Top, r.Right, r.Bottom);

        }

        /// <summary>
        /// 线条颜色
        /// </summary>
        public Color LineColor
        {
            get
            {
                return this.lineColor;
            }
            set
            {
                this.lineColor = value;
                PaintEventArgs pe = new PaintEventArgs(this.CreateGraphics(), this.ClientRectangle);
                this.OnPaint(pe);
            }

        }

        /// <summary>
        /// 线条宽度
        /// </summary>
        public int LineWidth
        {
            get { return this.lineWidth; }
            set
            {
                this.lineWidth = value;
                PaintEventArgs pe = new PaintEventArgs(this.CreateGraphics(), this.ClientRectangle);
                this.OnPaint(pe);
            }
        }

       

       


    }
}
